<?

$tmppath="../../";
REQUIRE ($tmppath."include/login.php");
REQUIRE ($tmppath.$templates."up.php");
REQUIRE($tmppath."protect/connect_jeu.php");






$query="SELECT ville_id,ville_name,ville_population,ville_timpot,ville_t_richesse, ville_distance FROM sdville WHERE ville_proprio=$userperso ORDER BY ville_date_crea";
$resultat=mysql_query($query);











//Chercher les inventions
//***********************




ECHO "<BR>

<table width=\"99%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#000000\"><tr>
    <td>";
ECHO"<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bordercolor=\"#000000\">
  <tr>
    <td><table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td width=\"20\" CLASS=\"TD3\"><div align=\"center\"><strong>Voir</strong></div></td>
          <td width=\"20\" class=\"TD3\"><div align=\"center\"><strong>Entrer</strong></div></td>
          <td width=\"100px\" class=\"TD3\"><div align=\"center\"><strong>Nom</strong></div></td>
          <td width=\"25px\" class=\"TD3\"><div align=\"center\"><strong>Population</strong></div></td>
           <td width=\"25px\" class=\"TD3\"><div align=\"center\"><strong>Impot</strong></div></td>
            <td width=\"15px\" class=\"TD3\"><div align=\"center\"><strong>Richesse</strong></div></td>
          <td width=\"30px\" class=\"TD3\"><div align=\"center\"><strong>Gain</strong></div></td>
          <td width=\"30px\" CLASS=\"TD3\"><div align=\"center\"><b>Distance</b></div></td>
          <td width=\"60px\" CLASS=\"TD3\"><div align=\"center\"><b>Cout</b></div></td>
          

        </tr>";

$var_tmp=0;
$nbr_cat=0;

WHILE ($tmp=mysql_fetch_array($resultat)){

$nbr_cat++;
IF ($var_tmp==0){
$bgr="class=\"TD1\"";
$var_tmp=1;

}
ELSE{
$bgr="";
$var_tmp=0;
$bgr="class=\"TD2\"";

}


                                           $tmpx=floor(($tmp[2]*(($tmp[3]/100)))*$tmp[4]);
                                           $total_impot+=$tmpx;
ECHO"<tr>
          <td $bgr><div align=\"center\"><a href=\"#\" onclick=\"window.open('../iframe/go_loc.php?choix=v&ID=$tmp[0]','frame_test')\";>Go!</div></a></div></td>
          <td $bgr><div align=\"center\"><a href=\"#\" onclick=\"window.open('../iframe/test_option_princ.php?p=test_ville&ID=$tmp[0]','frame_test');\">Go!</div></a></div></td>
          <td $bgr><div align=\"center\">$tmp[1]</div></td>
          <td $bgr><div align=\"center\">$tmp[2]</div></td>
          <td $bgr><div align=\"center\">$tmp[3]%</div></td>
          <td $bgr><div align=\"center\">$tmp[4]</div></td>
          <td $bgr><div align=\"center\">$tmpx <img src=\"../../images/jeu/icon/lorin.gif\"></div></td>
           <td $bgr><div align=\"center\">$tmp[5] </div></td>
          <td $bgr><div align=\"center\">".($tmp[5]*15)."<img src=\"../../images/jeu/icon/lorin.gif\"></div></td>

          </tr>";





}

echo "</tr>
    </td></table></tr>
    </td></table></tr>
    </td></table><br>";

//Affichage des caracteristique des invention.
//********************************************



$query="SELECT count(*) FROM sdville WHERE ville_proprio=$userperso";
$resultat=mysql_query($query);
$tmp=mysql_fetch_array($resultat);
$nbr_ville=$tmp[0];

echo"<table width=\"300\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" CLASS=fondblack>
  <tr>
    <td CLASS=td1><div align=\"center\">Total d'impot recu pour vos villes : $total_impot Lorin" ;

echo"</tr></table>";

?>

